home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / include / devices / parnet.h
C/C++ Source or Header  |  1994-02-01  |  3KB  |  82 lines

  1.  
  2. /*
  3.  *  DEVICES/PARNET.H
  4.  *
  5.  * (c)Copyright 1992 Obvious Implementations Corp, All Rights Reserved
  6.  */
  7.  
  8. #ifndef DEVICES_PARNET_H
  9. #define DEVICES_PARNET_H
  10.  
  11. #ifndef PARNET_SRC
  12. #define UNIT   APTR
  13. #define DEVICE APTR
  14. #else
  15. #define UNIT struct Unit
  16. #define DEVICE Device
  17. #endif
  18.  
  19. typedef struct {
  20.     struct  Message io_Message;
  21.     DEVICE  *io_Device;         /* device node pointer    */
  22.     UNIT    *io_Unit;            /* unit (protocol private)    */
  23.     UWORD   io_Command;         /* device command        */
  24.     UBYTE   io_Flags;            /* IOF_QUICK        */
  25.     BYTE    io_Error;            /* error or warning num    */
  26.     ULONG   io_Actual;            /* actual number of bytes transferred   */
  27.     ULONG   io_Length;            /* requested number bytes transferred   */
  28.     APTR    io_Data;            /* points to data area            */
  29.     ULONG   io_Offset;            /* offset for block structured devices  */
  30.     UWORD   io_Port;
  31.     UWORD   io_Addr;
  32.     APTR    io_Data2;            /* more data                */
  33.     ULONG   io_Length2;         /* must be 0 if you do not use these fields */
  34. } IOParReq;
  35.  
  36. /*
  37.  *  OpenDevice(), protocols.
  38.  *
  39.  *  DEFAULT
  40.  */
  41.  
  42. #define PRO_MASK    0x001F
  43. #define PRO_CONTROL    0x0000
  44. #define PRO_DGRAM    0x0001
  45. #define PRO_STREAM    0x0002
  46.  
  47. #define PRO_LAST    PRO_STREAM
  48.  
  49. /*
  50.  *  Extended Command Set
  51.  */
  52.  
  53. #define PPD_SETADDR    (CMD_NONSTD+0)        /*    set my network address    */
  54. #define PPD_SETTO    (CMD_NONSTD+1)        /*    set network timeout    */
  55. #define PPD_SHUTDOWN    (CMD_NONSTD+2)        /*    shutdown a stream conn. */
  56. #define PPD_CONNECT    (CMD_NONSTD+3)        /*    connect to a port    */
  57. #define PPD_LISTEN    (CMD_NONSTD+5)        /*    listen for a connection */
  58.  
  59. /*
  60.  *  Extended Error codes    (placed in io_Actual for OpenDevice() call)
  61.  */
  62.  
  63. #define PPERR_NOPORTRES     -32     /*  can't get MR_PARALLELPORT misc res. */
  64. #define PPERR_NOBITSRES     -33     /*  can't get MR_PARALLELBITS misc res. */
  65. #define PPERR_NOTASK        -34     /*  can't create sub task               */
  66. #define PPERR_NOINT        -35     /*  can't allocate CIAA-FLAG interrupt  */
  67. #define PPERR_BADPROTOCOL   -36     /*  illegal protocol requested        */
  68. #define PPERR_BADFLAGS        -37     /*  illegal flags for protocol        */
  69. #define PPERR_ILLPORT        -38     /*  illegal port for protocol            */
  70. #define PPERR_ILLPORTLSN    -39     /*  somebody already listening on that port!    */
  71. #define PPERR_NOTIMPL        -40     /*  not implemented yet.        */
  72.  
  73. #define PPERR_WARN_OVFLOW   -41     /*  dgram, data overflow        */
  74. #define PPERR_PORT_IN_USE   -42     /*  port is in use by another protocol    */
  75. #define PPERR_NO_PORTS        -43     /*  no more ports available !!        */
  76. #define PPERR_HOSTDOWN1     -44     /*  remote machine does not respond    */
  77. #define PPERR_HOSTDOWN2     -45     /*  remote machine does not respond    */
  78.  
  79. #endif
  80.  
  81.  
  82.